package com.chris.blog.service.impl;

import com.chris.blog.dao.UserRoleDao;
import com.chris.blog.entity.po.UserRolePO;
import com.chris.blog.service.UserRoleService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;

@Service
public class UserRoleServiceImpl implements UserRoleService {

    @Resource
    private UserRoleDao userRoleDAO;

    @Transactional(rollbackFor = Exception.class)
    @Override
    public int deleteByPrimaryKey(Integer id) {
        return userRoleDAO.deleteByPrimaryKey(id);
    }

    @Transactional(rollbackFor = Exception.class)
    @Override
    public int insert(UserRolePO record) {
        return userRoleDAO.insert(record);
    }

    @Transactional(rollbackFor = Exception.class)
    @Override
    public int insertSelective(UserRolePO record) {
        return userRoleDAO.insertSelective(record);
    }

    @Override
    public UserRolePO selectByPrimaryKey(Integer id) {
        return userRoleDAO.selectByPrimaryKey(id);
    }

    @Transactional(rollbackFor = Exception.class)
    @Override
    public int updateByPrimaryKeySelective(UserRolePO record) {
        return userRoleDAO.updateByPrimaryKeySelective(record);
    }

    @Transactional(rollbackFor = Exception.class)
    @Override
    public int updateByPrimaryKey(UserRolePO record) {
        return userRoleDAO.updateByPrimaryKey(record);
    }

}
